package com.enjoy.springboot;

import com.enjoy.springboot.anno.WhhConditionalOnClass;
import com.enjoy.springboot.interfaces.AutoConfiguration;
import com.enjoy.springboot.server.JettyServer;
import com.enjoy.springboot.server.TomcatServer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class WebServiceAutoConfiguration implements AutoConfiguration {

    @Bean
    @WhhConditionalOnClass("org.apache.catalina.startup.Tomcat")
    public TomcatServer tomcatServer(){
        return new TomcatServer();
    }

    @Bean
    @WhhConditionalOnClass("org.eclipse.jetty.server.Server")
    public JettyServer jettyServer(){
        return new JettyServer();
    }
}
